package JAVA300.第十一章多线程;

/**
 * lamda表达式测试理解
 */
public class thread_09_lamdaTest {

    //2。静态内部类
    static class huawei implements Computer {
        @Override
        public void compute() {
            System.out.println("这是华为笔记本");
        }
    }
    public static void main(String[] args) {
        Computer com1 = new lenovo();
        com1.compute();

        Computer com2 = new huawei();
        com2.compute();

        //3.方法内部类
        class apple implements Computer {
            @Override
            public void compute() {
                System.out.println("这是苹果笔记本");
            }
        }
        Computer com3 = new huawei();
        com2.compute();
        //4.匿名内部类
        Computer com4 = new Computer() {
            @Override
            public void compute() {
                System.out.println("这是匿名内部类笔记本");

            }
        };
        com4.compute();
        //5.lamda
        Computer com5 = () ->{

                System.out.println("这是lamda笔记本");

        };
        com5.compute();




    }
}

interface Computer{
    void compute();
}

//1.经典接口实现
class lenovo implements Computer{
    @Override
    public void compute() {
        System.out.println("这是联想笔记本");
    }

}
